<!doctype html>
<html lang="en">
<head>
    <title>Code coverage report for db\UserMysql.js</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="../prettify.css" />
    <link rel="stylesheet" href="../base.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style type='text/css'>
        .coverage-summary .sorter {
            background-image: url(../sort-arrow-sprite.png);
        }
    </style>
</head>
<body>
<div class='wrapper'>
  <div class='pad1'>
    <h1>
      <a href="../index.html">all files</a> / <a href="index.html">db/</a> UserMysql.js
    </h1>
    <div class='clearfix'>
      <div class='fl pad1y space-right2'>
        <span class="strong">10.26% </span>
        <span class="quiet">Statements</span>
        <span class='fraction'>32/312</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Branches</span>
        <span class='fraction'>0/78</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Functions</span>
        <span class='fraction'>0/62</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">10.26% </span>
        <span class="quiet">Lines</span>
        <span class='fraction'>32/312</span>
      </div>
    </div>
  </div>
  <div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">/**
 * Created by Administrator on 2018/7/29.
 */
/**
 * Created by Administrator on 2018/7/28.
 */
var mysql=require('mysql');
&nbsp;
var _Date=require("../utils/Date");
var conn_pool=mysql.createPool({
    host:"127.0.0.1" ,
    port:3306,
    database:"accountmysql",
    user:"root",
    password:"03251222yxn"
});
<span class="fstat-no" title="function not covered" >function isAvailableData(data){</span>
<span class="cstat-no" title="statement not covered" >    console.log("进入isAvailableData方法");</span>
<span class="cstat-no" title="statement not covered" >    if(data instanceof Object){</span>
<span class="cstat-no" title="statement not covered" >        console.log("14:",data);</span>
<span class="cstat-no" title="statement not covered" >        return {encode:0,data:data};</span>
&nbsp;
    }else{
<span class="cstat-no" title="statement not covered" >        try{</span>
            //console.log("25:",typeof JSON.parse(data));
<span class="cstat-no" title="statement not covered" >            data=JSON.parse(data);</span>
<span class="cstat-no" title="statement not covered" >            console.log("27:",typeof data);</span>
<span class="cstat-no" title="statement not covered" >            return {encode:0,data:data};</span>
        }catch (err){
<span class="cstat-no" title="statement not covered" >            console.log("23:",data);</span>
<span class="cstat-no" title="statement not covered" >            return {encode:-1,data:data}</span>
        }
    }
}
<span class="fstat-no" title="function not covered" >function mysql_exce(sql,callback){</span>
<span class="cstat-no" title="statement not covered" >    conn_pool.getConnection(<span class="fstat-no" title="function not covered" >function (err,conn) {</span></span>
<span class="cstat-no" title="statement not covered" >        if(err){</span>
<span class="cstat-no" title="statement not covered" >            console.log("连接数据库失败",err);</span>
<span class="cstat-no" title="statement not covered" >            return;</span>
        }else {
<span class="cstat-no" title="statement not covered" >            console.log("连接数据库成功");</span>
<span class="cstat-no" title="statement not covered" >            conn.query(sql, <span class="fstat-no" title="function not covered" >function (sql_err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >                if(sql_err){</span>
<span class="cstat-no" title="statement not covered" >                    if(callback){</span>
<span class="cstat-no" title="statement not covered" >                        callback(sql_err,null,null);</span>
<span class="cstat-no" title="statement not covered" >                        conn.release();</span>
                    }
<span class="cstat-no" title="statement not covered" >                    return;</span>
                }
<span class="cstat-no" title="statement not covered" >                if(callback){</span>
<span class="cstat-no" title="statement not covered" >                    callback(null,sql_result,fields_desic);</span>
<span class="cstat-no" title="statement not covered" >                    conn.release();</span>
                }
            });
        }
&nbsp;
&nbsp;
    });
}
//用户第一次手机登录，将用户信息保存到数据库
exports.addUser= <span class="fstat-no" title="function not covered" >function (userInfo,callback) {</span>//{uid:,openid:,bindingType:,email:,app:,platform:,channel:,bindingMsg:{}}
<span class="cstat-no" title="statement not covered" >    let bindingType=userInfo.bindingType;</span>
<span class="cstat-no" title="statement not covered" >    let appList=[];</span>
<span class="cstat-no" title="statement not covered" >    appList.push(userInfo.app);</span>
<span class="cstat-no" title="statement not covered" >    appList.push("h1v2");</span>
<span class="cstat-no" title="statement not covered" >    switch (bindingType){</span>
        case 0://普通用户bindingMsg:{uname:,password:,}
<span class="cstat-no" title="statement not covered" >            let sql_0=`insert into user(uid,openid,uname,password,registertime,app,platform,channel)\</span>
     values("${userInfo.uid}","${userInfo.openid}","${userInfo.bindingMsg.uname}","${userInfo.bindingMsg.password}","${userInfo.registertime}","${appList}",${userInfo.platform},${userInfo.channel})`;
<span class="cstat-no" title="statement not covered" >            console.log("UserMysql-68:",sql_0);</span>
<span class="cstat-no" title="statement not covered" >            mysql_exce(sql_0, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >                if(err){</span>
<span class="cstat-no" title="statement not covered" >                    console.log(err);</span>
<span class="cstat-no" title="statement not covered" >                    callback(err,null);</span>
                }else {
<span class="cstat-no" title="statement not covered" >                    callback(null,sql_result);</span>
                }
            });
<span class="cstat-no" title="statement not covered" >            break;</span>
        case 1://微信小游戏
<span class="cstat-no" title="statement not covered" >            let sql_1=`insert into user(uid,openid,registertime,app,wx,platform,channel)\</span>
     values("${userInfo.uid}","${userInfo.openid}",\
     "${userInfo.registertime}","${appList}","${userInfo.wx}",${userInfo.platform},${userInfo.channel})`;
<span class="cstat-no" title="statement not covered" >            console.log("UserMysql-68:",sql_1);</span>
<span class="cstat-no" title="statement not covered" >            mysql_exce(sql_1, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >                if(err){</span>
<span class="cstat-no" title="statement not covered" >                    console.log(err);</span>
<span class="cstat-no" title="statement not covered" >                    callback(err,null);</span>
                }else {
<span class="cstat-no" title="statement not covered" >                    callback(null,sql_result);</span>
                }
            });
<span class="cstat-no" title="statement not covered" >            break;</span>
        case 2://手机用户
<span class="cstat-no" title="statement not covered" >            let sql_2=`insert into user(uid,openid,phone,registertime,app,platform,channel)\</span>
     values("${userInfo.uid}","${userInfo.openid}","${userInfo.bindingMsg.phone}","${userInfo.registertime}","${appList}",${userInfo.platform},${userInfo.channel})`;
<span class="cstat-no" title="statement not covered" >            console.log("UserMysql-68:",sql_2);</span>
<span class="cstat-no" title="statement not covered" >            mysql_exce(sql_2, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >                if(err){</span>
<span class="cstat-no" title="statement not covered" >                    console.log(err);</span>
<span class="cstat-no" title="statement not covered" >                    callback(err,null);</span>
                }else {
<span class="cstat-no" title="statement not covered" >                    callback(null,sql_result);</span>
                }
            });
<span class="cstat-no" title="statement not covered" >            break;</span>
        case 3://原版微信用户
&nbsp;
<span class="cstat-no" title="statement not covered" >            let sql_3=`insert into user(uid,openid,registertime,app,wx,platform,channel)\</span>
     values("${userInfo.uid}","${userInfo.openid}",\
     "${userInfo.registertime}","${appList}","${userInfo.wx}",${userInfo.platform},${userInfo.channel})`;
<span class="cstat-no" title="statement not covered" >            console.log("UserMysql-68:",sql_3);</span>
<span class="cstat-no" title="statement not covered" >            mysql_exce(sql_3, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >                if(err){</span>
<span class="cstat-no" title="statement not covered" >                    console.log(err);</span>
<span class="cstat-no" title="statement not covered" >                    callback(err,null);</span>
                }else {
<span class="cstat-no" title="statement not covered" >                    callback(null,sql_result);</span>
                }
            });
<span class="cstat-no" title="statement not covered" >            break;</span>
        case 5://
<span class="cstat-no" title="statement not covered" >            let sql_5=`insert into user(uid,openid,registertime,app,xl,platform,channel)\</span>
     values("${userInfo.uid}","${userInfo.openid}",\
     "${userInfo.registertime}","${appList}","${userInfo.xl}",${userInfo.platform},${userInfo.channel})`;
<span class="cstat-no" title="statement not covered" >            console.log("UserMysql-126:",sql_5);</span>
<span class="cstat-no" title="statement not covered" >            mysql_exce(sql_5, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >                if(err){</span>
<span class="cstat-no" title="statement not covered" >                    console.log(err);</span>
<span class="cstat-no" title="statement not covered" >                    callback(err,null);</span>
                }else {
<span class="cstat-no" title="statement not covered" >                    callback(null,sql_result);</span>
                }
            });
<span class="cstat-no" title="statement not covered" >            break;</span>
    }
&nbsp;
};
exports.addUserRegister= <span class="fstat-no" title="function not covered" >function (userInfo,callback) {</span>//邮箱
<span class="cstat-no" title="statement not covered" >    let bindingType=userInfo.bindingType;</span>
<span class="cstat-no" title="statement not covered" >    let appList=[];</span>
<span class="cstat-no" title="statement not covered" >    appList.push(userInfo.app);</span>
<span class="cstat-no" title="statement not covered" >    appList.push("h1v2");</span>
<span class="cstat-no" title="statement not covered" >    bindingType=parseInt(bindingType);</span>
<span class="cstat-no" title="statement not covered" >    switch (bindingType){</span>
        case 5:
<span class="cstat-no" title="statement not covered" >            let sql_0=`insert into user(uid,openid,password,registertime,app,platform,channel,email)\</span>
     values("${userInfo.uid}","${userInfo.openid}","${userInfo.password}","${userInfo.registertime}","${appList}",${userInfo.platform},${userInfo.channel},"${userInfo.bindingMsg.email}")`;
<span class="cstat-no" title="statement not covered" >            console.log("UserMysql-68:",sql_0);</span>
<span class="cstat-no" title="statement not covered" >            mysql_exce(sql_0, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >                if(err){</span>
<span class="cstat-no" title="statement not covered" >                    console.log(err);</span>
<span class="cstat-no" title="statement not covered" >                    callback(err,null);</span>
                }else {
<span class="cstat-no" title="statement not covered" >                    callback(null,sql_result);</span>
                }
            });
<span class="cstat-no" title="statement not covered" >            break;</span>
    }
&nbsp;
};
exports.getUserByOpenId=<span class="fstat-no" title="function not covered" >function (userInfo,callback) {</span>////userInfo:{uname:,password（hex）:}
<span class="cstat-no" title="statement not covered" >    var sql=`select * from user where openid="${userInfo.openId}"`;</span>
<span class="cstat-no" title="statement not covered" >    mysql_exce(sql, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >        console.log("sql_result:",sql_result);</span>
<span class="cstat-no" title="statement not covered" >        if(err){</span>
<span class="cstat-no" title="statement not covered" >            console.log(err);</span>
<span class="cstat-no" title="statement not covered" >            callback(err,null);</span>
        }else{
<span class="cstat-no" title="statement not covered" >            callback(null,sql_result);</span>
        }
    })
};
exports.getUserPwdByOpenId= <span class="fstat-no" title="function not covered" >function (userInfo,callback) {</span>
<span class="cstat-no" title="statement not covered" >    var sql=`select password from user where openid="${userInfo.openId}"`;</span>
<span class="cstat-no" title="statement not covered" >    mysql_exce(sql, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >        console.log("sql_result:",sql_result);</span>
<span class="cstat-no" title="statement not covered" >        if(err){</span>
<span class="cstat-no" title="statement not covered" >            console.log(err);</span>
<span class="cstat-no" title="statement not covered" >            callback(err,null);</span>
        }else{
<span class="cstat-no" title="statement not covered" >            callback(null,sql_result);</span>
        }
    })
};
/*var sql=`select password from user where openid="MTY2MjIxNTc1MjQ="`;
mysql_exce(sql, function (err,sql_result,fields_desic) {
    console.log("sql_result:",sql_result);
    if(err){
        console.log(err);
    }else{
        console.log(sql_result[0].password===null);
    }
})*/
&nbsp;
//----------------------------------------------------------------邮箱--------------------------------------------------------------
exports.getUserByEmail= <span class="fstat-no" title="function not covered" >function (userInfo,callback) {</span>////userInfo:{email:}
<span class="cstat-no" title="statement not covered" >    let email=userInfo.email;</span>
<span class="cstat-no" title="statement not covered" >    var sql="select * from user where email=\""+email+"\"";</span>
<span class="cstat-no" title="statement not covered" >    mysql_exce(sql, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >        console.log("sql_result:",sql_result);</span>
<span class="cstat-no" title="statement not covered" >        if(err){</span>
<span class="cstat-no" title="statement not covered" >            console.log(err);</span>
<span class="cstat-no" title="statement not covered" >            callback(err,null);</span>
        }else{
<span class="cstat-no" title="statement not covered" >            callback(null,sql_result);</span>
        }
    })
};
exports.getUserByEmailAndPwd= <span class="fstat-no" title="function not covered" >function (userInfo,callback) {</span>
<span class="cstat-no" title="statement not covered" >    let email=userInfo.bindingMsg.email;</span>
<span class="cstat-no" title="statement not covered" >    let password=userInfo.bindingMsg.password;</span>
<span class="cstat-no" title="statement not covered" >    let sql=`select * from user where email="${email}" and password="${password}"`;</span>
<span class="cstat-no" title="statement not covered" >    mysql_exce(sql, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >        if(err){</span>
<span class="cstat-no" title="statement not covered" >            callback(err,null);</span>
        }else {
<span class="cstat-no" title="statement not covered" >            callback(null,sql_result);</span>
        }
    });
};
exports.updatePwdByOpenId=<span class="fstat-no" title="function not covered" >function (userInfo,callback) {</span>
<span class="cstat-no" title="statement not covered" >    let openId=userInfo.openId;</span>
<span class="cstat-no" title="statement not covered" >    let password=userInfo.password;</span>
<span class="cstat-no" title="statement not covered" >    let sql=`update user set password="${password}" where openid="${openId}"`;</span>
<span class="cstat-no" title="statement not covered" >    console.log("UserMysql-197:",sql);</span>
<span class="cstat-no" title="statement not covered" >    mysql_exce(sql, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >        if(err){</span>
<span class="cstat-no" title="statement not covered" >            console.log(err);</span>
<span class="cstat-no" title="statement not covered" >            callback(err,null);</span>
        }else {
<span class="cstat-no" title="statement not covered" >            callback(null,sql_result);</span>
        }
    });
};
exports.updateEmailByOpenId= <span class="fstat-no" title="function not covered" >function (userInfo,callback) {</span>
<span class="cstat-no" title="statement not covered" >    let openId=userInfo.openId;</span>
<span class="cstat-no" title="statement not covered" >    let email=userInfo.bindingMsg.email;</span>
<span class="cstat-no" title="statement not covered" >    let sql=`update user set email="${email}" where openid="${openId}"`;</span>
<span class="cstat-no" title="statement not covered" >    console.log("UserMysql-197:",sql);</span>
<span class="cstat-no" title="statement not covered" >    mysql_exce(sql, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >        if(err){</span>
<span class="cstat-no" title="statement not covered" >            console.log(err);</span>
<span class="cstat-no" title="statement not covered" >            callback(err,null);</span>
        }else {
<span class="cstat-no" title="statement not covered" >            callback(null,sql_result);</span>
        }
    });
};
exports.dropUserByEmail=<span class="fstat-no" title="function not covered" >function (userInfo,callback) {</span>
<span class="cstat-no" title="statement not covered" >    let email=userInfo.bindingMsg.email;</span>
<span class="cstat-no" title="statement not covered" >    let sql=`delete from user where email="${email}"`;</span>
<span class="cstat-no" title="statement not covered" >    console.log("UserMysql-197:",sql);</span>
<span class="cstat-no" title="statement not covered" >    mysql_exce(sql, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >        if(err){</span>
<span class="cstat-no" title="statement not covered" >            console.log(err);</span>
<span class="cstat-no" title="statement not covered" >            callback(err,null);</span>
        }else {
<span class="cstat-no" title="statement not covered" >            callback(null,sql_result);</span>
        }
    });
};
//--------------------------------------------------------------普通用户---------------------------------------------------------
//根据用户名获取用户信息
exports.getUserByName= <span class="fstat-no" title="function not covered" >function (userInfo,callback) {</span>////userInfo:{uname:,password（hex）:}
<span class="cstat-no" title="statement not covered" >    let uname=userInfo.uname;</span>
<span class="cstat-no" title="statement not covered" >    let password=userInfo.password;</span>
<span class="cstat-no" title="statement not covered" >    var sql="select * from user where uname=\""+uname+"\"";</span>
<span class="cstat-no" title="statement not covered" >    mysql_exce(sql, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >        console.log("sql_result:",sql_result);</span>
<span class="cstat-no" title="statement not covered" >        if(err){</span>
<span class="cstat-no" title="statement not covered" >            console.log(err);</span>
<span class="cstat-no" title="statement not covered" >            callback(err,null);</span>
        }else{
<span class="cstat-no" title="statement not covered" >            callback(null,sql_result);</span>
        }
    })
};
exports.getUserByNameAndPassWord= <span class="fstat-no" title="function not covered" >function (userInfo,callback) {</span>////userInfo:{uname:,password（hex）:}
<span class="cstat-no" title="statement not covered" >    let uname=userInfo.uname;</span>
<span class="cstat-no" title="statement not covered" >    let password=userInfo.password;</span>
<span class="cstat-no" title="statement not covered" >    console.log("==========================156:",password);</span>
<span class="cstat-no" title="statement not covered" >    var sql="select * from user where uname=\""+uname+"\" and password=\""+password+"\"";</span>
<span class="cstat-no" title="statement not covered" >    mysql_exce(sql, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >        console.log("sql_result:",sql_result);</span>
<span class="cstat-no" title="statement not covered" >        if(err){</span>
<span class="cstat-no" title="statement not covered" >            console.log(err);</span>
<span class="cstat-no" title="statement not covered" >            callback(err,null);</span>
        }else{
<span class="cstat-no" title="statement not covered" >            callback(null,sql_result);</span>
        }
    })
};
exports.updateApp= <span class="fstat-no" title="function not covered" >function (userInfo,callback) {</span>
<span class="cstat-no" title="statement not covered" >    let appList=userInfo.app;</span>
<span class="cstat-no" title="statement not covered" >    let sql=`update user set app="${appList}" where uname="${userInfo.bindingMsg.uname}"`;</span>
<span class="cstat-no" title="statement not covered" >    console.log("UserMysql-68:",sql);</span>
<span class="cstat-no" title="statement not covered" >    mysql_exce(sql, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >        if(err){</span>
<span class="cstat-no" title="statement not covered" >            console.log(err);</span>
<span class="cstat-no" title="statement not covered" >            callback(err,null);</span>
        }else {
<span class="cstat-no" title="statement not covered" >            callback(null,sql_result);</span>
        }
    });
};
//--------------------------------------------------------------手机号用户------------------------------------------------------
exports.getUserByPhone= <span class="fstat-no" title="function not covered" >function (userInfo,callback) {</span>
<span class="cstat-no" title="statement not covered" >    let phone=userInfo.bindingMsg.phone;</span>
<span class="cstat-no" title="statement not covered" >    let sql=`select * from user where phone="${phone}"`;</span>
<span class="cstat-no" title="statement not covered" >    mysql_exce(sql, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >        if(err){</span>
<span class="cstat-no" title="statement not covered" >            callback(err,null);</span>
        }else {
<span class="cstat-no" title="statement not covered" >            callback(null,sql_result);</span>
        }
    });
};
exports.getUserByPhoneAndPwd= <span class="fstat-no" title="function not covered" >function (userInfo,callback) {</span>
<span class="cstat-no" title="statement not covered" >    let phone=userInfo.bindingMsg.phone;</span>
<span class="cstat-no" title="statement not covered" >    let password=userInfo.bindingMsg.password;</span>
<span class="cstat-no" title="statement not covered" >    let sql=`select * from user where phone="${phone}" and password="${password}"`;</span>
<span class="cstat-no" title="statement not covered" >    mysql_exce(sql, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >        if(err){</span>
<span class="cstat-no" title="statement not covered" >            callback(err,null);</span>
        }else {
<span class="cstat-no" title="statement not covered" >            callback(null,sql_result);</span>
        }
    });
};
exports.updatePhoneByOpenId= <span class="fstat-no" title="function not covered" >function (userInfo,callback) {</span>
<span class="cstat-no" title="statement not covered" >    let openId=userInfo.openId;</span>
<span class="cstat-no" title="statement not covered" >    let phone=userInfo.bindingMsg.phone;</span>
<span class="cstat-no" title="statement not covered" >    let sql=`update user set phone="${phone}" where openid="${openId}"`;</span>
<span class="cstat-no" title="statement not covered" >    console.log("UserMysql-197:",sql);</span>
<span class="cstat-no" title="statement not covered" >    mysql_exce(sql, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >        if(err){</span>
<span class="cstat-no" title="statement not covered" >            console.log(err);</span>
<span class="cstat-no" title="statement not covered" >            callback(err,null);</span>
        }else {
<span class="cstat-no" title="statement not covered" >            callback(null,sql_result);</span>
        }
    });
};
//----------------------------------------------------------------微博----------------------------------------------------------------
exports.getUserByWb=<span class="fstat-no" title="function not covered" >function (userInfo,callback) {</span>
<span class="cstat-no" title="statement not covered" >    let xl=isAvailableData(userInfo.xl).data;</span>
<span class="cstat-no" title="statement not covered" >    console.log(typeof xl);</span>
<span class="cstat-no" title="statement not covered" >    let idstr=xl.idstr;</span>
<span class="cstat-no" title="statement not covered" >    console.log("UserMysql-143:",idstr);</span>
<span class="cstat-no" title="statement not covered" >    var sql=`select * from user where xl like "%${idstr}%"`;</span>
<span class="cstat-no" title="statement not covered" >    mysql_exce(sql, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >        if(err){</span>
<span class="cstat-no" title="statement not covered" >            callback(err,null);</span>
        }else {
<span class="cstat-no" title="statement not covered" >            callback(null,sql_result);</span>
        }
    });
}
//--------------------------------------------------------------微信用户--------------------------------------------------------------
exports.getUserByWx= <span class="fstat-no" title="function not covered" >function (userInfo,callback) {</span>
<span class="cstat-no" title="statement not covered" >    let wx=isAvailableData(userInfo.wx).data;</span>
<span class="cstat-no" title="statement not covered" >    console.log(typeof wx);</span>
<span class="cstat-no" title="statement not covered" >    let openId=wx.openId;</span>
<span class="cstat-no" title="statement not covered" >    console.log("UserMysql-143:",openId);</span>
<span class="cstat-no" title="statement not covered" >    var sql=`select * from user where wx like "%${openId}%"`;</span>
<span class="cstat-no" title="statement not covered" >    mysql_exce(sql, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >        if(err){</span>
<span class="cstat-no" title="statement not covered" >            callback(err,null);</span>
        }else {
<span class="cstat-no" title="statement not covered" >            callback(null,sql_result);</span>
        }
    });
};
exports.updateWxByOpenId=<span class="fstat-no" title="function not covered" >function (userInfo,callback) {</span>
<span class="cstat-no" title="statement not covered" >    let openId=userInfo.openId;</span>
<span class="cstat-no" title="statement not covered" >    let wx=userInfo.wx;</span>
<span class="cstat-no" title="statement not covered" >    let sql=`update user set wx="${wx}" where openid="${openId}"`;</span>
<span class="cstat-no" title="statement not covered" >    console.log("UserMysql-226:",sql);</span>
<span class="cstat-no" title="statement not covered" >    mysql_exce(sql, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >        if(err){</span>
<span class="cstat-no" title="statement not covered" >            console.log(err);</span>
<span class="cstat-no" title="statement not covered" >            callback(err,null);</span>
        }else {
<span class="cstat-no" title="statement not covered" >            callback(null,sql_result);</span>
        }
    });
};
exports.updateAppByOpenId= <span class="fstat-no" title="function not covered" >function (userInfo,callback) {</span>
<span class="cstat-no" title="statement not covered" >    let appList=userInfo.app;</span>
<span class="cstat-no" title="statement not covered" >    let sql=`update user set app="${appList}" where openid="${userInfo.openid}"`;</span>
<span class="cstat-no" title="statement not covered" >    console.log("UserMysql-68:",sql);</span>
<span class="cstat-no" title="statement not covered" >    mysql_exce(sql, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >        if(err){</span>
<span class="cstat-no" title="statement not covered" >            console.log(err);</span>
<span class="cstat-no" title="statement not covered" >            callback(err,null);</span>
        }else {
<span class="cstat-no" title="statement not covered" >            callback(null,sql_result);</span>
        }
    });
}
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
//根据用户名获取用户信息
exports.getPlayerByName= <span class="fstat-no" title="function not covered" >function (name,callback) {</span>
<span class="cstat-no" title="statement not covered" >    console.log("mysql_user.js/getUserByName");</span>
<span class="cstat-no" title="statement not covered" >    var sql="select * from player where name=\""+name+"\"";</span>
<span class="cstat-no" title="statement not covered" >    mysql_exce(sql, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >        console.log("sql_result:",sql_result);</span>
<span class="cstat-no" title="statement not covered" >        if(err){</span>
            //console.log(err);
<span class="cstat-no" title="statement not covered" >            callback(err,null);</span>
        }else {
<span class="cstat-no" title="statement not covered" >            callback(null,sql_result);</span>
        }
&nbsp;
    })
};
//根据用户名获取用户信息(微信小游戏版本)
exports.getPlayerByOpenId= <span class="fstat-no" title="function not covered" >function (openid,callback) {</span>
<span class="cstat-no" title="statement not covered" >    console.log("mysql_user.js/getUserByOpenid");</span>
<span class="cstat-no" title="statement not covered" >    console.log("UserMysql-75:",openid);</span>
<span class="cstat-no" title="statement not covered" >    var sql="select * from player where openid=\""+openid+"\"";</span>
<span class="cstat-no" title="statement not covered" >    console.log("UserMysql-77:",sql);</span>
<span class="cstat-no" title="statement not covered" >    mysql_exce(sql, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >        console.log("sql_result:",sql_result);</span>
<span class="cstat-no" title="statement not covered" >        if(err){</span>
            //console.log(err);
<span class="cstat-no" title="statement not covered" >            callback(err,null);</span>
        }else {
<span class="cstat-no" title="statement not covered" >            callback(null,sql_result);</span>
        }
&nbsp;
    })
};
&nbsp;
//获取所有玩家的所有数据
exports.getAllPlayer= <span class="fstat-no" title="function not covered" >function (callback) {</span>
<span class="cstat-no" title="statement not covered" >    var sql="select * from player";</span>
<span class="cstat-no" title="statement not covered" >    mysql_exce(sql, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >        console.log("sql_result:",sql_result);</span>
<span class="cstat-no" title="statement not covered" >        if(err){</span>
            //console.log(err);
<span class="cstat-no" title="statement not covered" >            callback(err,null);</span>
        }else {
<span class="cstat-no" title="statement not covered" >            callback(null,sql_result);</span>
        }
&nbsp;
    })
};
//根据用户的pid获取信息
exports.getPlayerByPid= <span class="fstat-no" title="function not covered" >function (pid,callback) {</span>
<span class="cstat-no" title="statement not covered" >    var sql="select * from player where pid="+pid;</span>
<span class="cstat-no" title="statement not covered" >    mysql_exce(sql, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >        console.log("sql_result:",sql_result);</span>
<span class="cstat-no" title="statement not covered" >        if(err){</span>
            //console.log(err);
<span class="cstat-no" title="statement not covered" >            callback(err,null);</span>
        }else {
<span class="cstat-no" title="statement not covered" >            callback(null,sql_result);</span>
        }
&nbsp;
    })
};
&nbsp;
//修改用户的信息
exports.updatePlayer= <span class="fstat-no" title="function not covered" >function (pid,name,integral,universal,time,logintype,level,exper,callback) {</span>
<span class="cstat-no" title="statement not covered" >    console.log("universal:",universal);</span>
<span class="cstat-no" title="statement not covered" >    console.log((JSON.parse(universal)).victory);</span>
<span class="cstat-no" title="statement not covered" >    universal=JSON.parse(universal);</span>
<span class="cstat-no" title="statement not covered" >    console.log("pid:",pid);</span>
    //var sql="update player set name=\""+name+"\",integral="+integral+",universal=\"\""+universal+"\"\",time=\""+time+"\",logintype="+logintype+",level="+level+",exper="+exper+" where pid="+pid;
<span class="cstat-no" title="statement not covered" >    var sql=`update player set name="${name}",universal="{\\\"victory\\\":${universal.victory},\\\"games\\\":${universal.games}}",integral=${integral},time=${time},logintype=${logintype},level=${level},exper=${exper} where pid=${pid}`;</span>
<span class="cstat-no" title="statement not covered" >    mysql_exce(sql, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >        console.log("sql_result:",sql_result);</span>
<span class="cstat-no" title="statement not covered" >        if(err){</span>
            //console.log(err);
<span class="cstat-no" title="statement not covered" >            callback(err,null);</span>
        }else {
<span class="cstat-no" title="statement not covered" >            callback(null,{msg:1});</span>
        }
&nbsp;
    });
};
//修改用户的信息(微信小游戏版本)
exports.updatePlayerName= <span class="fstat-no" title="function not covered" >function (openid,name,callback) {</span>
    //var sql="update player set name=\""+name+"\",integral="+integral+",universal=\"\""+universal+"\"\",time=\""+time+"\",logintype="+logintype+",level="+level+",exper="+exper+" where pid="+pid;
<span class="cstat-no" title="statement not covered" >    var sql=`update player set name="${name}" where openid="${openid}"`;</span>
<span class="cstat-no" title="statement not covered" >    mysql_exce(sql, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >        console.log("sql_result:",sql_result);</span>
<span class="cstat-no" title="statement not covered" >        if(err){</span>
<span class="cstat-no" title="statement not covered" >            console.log(err);</span>
<span class="cstat-no" title="statement not covered" >            callback(err,null);</span>
        }else{
<span class="cstat-no" title="statement not covered" >            callback(null,{msg:1});</span>
        }
&nbsp;
    });
};
//更新胜利用户的积分以及场数
exports.updateIntegral_victory= <span class="fstat-no" title="function not covered" >function (name,integral,victory,games,callback) {</span>
<span class="cstat-no" title="statement not covered" >    var sql1=`update player set integral=${integral},universal="{\\\"victory\\\":${victory},\\\"games\\\":${games}}" where name="${name}"`;</span>
<span class="cstat-no" title="statement not covered" >    console.log(sql1);</span>
    // var sql="update player set integral="+integral+",universal=json_set('{\"victory\":0,\"games\":0}','$.victory',"+victory+",'$.games',"+games+")"+" where name=\""+name+"\"";
<span class="cstat-no" title="statement not covered" >    mysql_exce(sql1, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >        if(err){</span>
<span class="cstat-no" title="statement not covered" >            callback(err,null);</span>
        }
<span class="cstat-no" title="statement not covered" >        callback(null,sql_result);</span>
    });
};
//更新失败用户的积分以及场数
exports.updateIntegral_loser= <span class="fstat-no" title="function not covered" >function (name,integral,victory,games,callback) {</span>
<span class="cstat-no" title="statement not covered" >    var sql2=`update player set integral=${integral},universal="{\\\"victory\\\":${victory},\\\"games\\\":${games}}" where name="${name}"`;</span>
<span class="cstat-no" title="statement not covered" >    console.log(sql2);</span>
    //var sql="update player set integral="+integral+",universal=json_set('{\"victory\":0,\"games\":0}','$.victory',"+victory+",'$.games',"+games+")"+" where name=\""+name+"\"";
<span class="cstat-no" title="statement not covered" >    mysql_exce(sql2, <span class="fstat-no" title="function not covered" >function (err,sql_result,fields_desic) {</span></span>
<span class="cstat-no" title="statement not covered" >        console.log("^^^^^^^^^^^^^^^^^:",sql_result);</span>
<span class="cstat-no" title="statement not covered" >        if(err){</span>
<span class="cstat-no" title="statement not covered" >            callback(err,null);</span>
        }
<span class="cstat-no" title="statement not covered" >        callback(null,sql_result);</span>
    });
};
&nbsp;
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
  Code coverage
  generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Aug 15 2018 11:42:06 GMT+0800 (中国标准时间)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
        if (typeof prettyPrint === 'function') {
            prettyPrint();
        }
};
</script>
<script src="../sorter.js"></script>
</body>
</html>
